package com.itheima.day20.demo07;

import java.util.function.Consumer;

public class ConsumerDemo03 {
    public static void main(String[] args) {
        String[] array = {"迪丽热巴,女", "古力娜扎,女", "马尔扎哈,男", "赵丽颖,女"};

        printArray(array, e -> System.out.print("姓名:" + e.split(",")[0]), e -> System.out.println(",性别:" + e.split(",")[1]));
    }

    public static <T> void printArray(T[] t, Consumer<T> one, Consumer<T> two) {
        for (T t1 : t) {
            one.andThen(two).accept(t1);
        }
    }
}
